package com.bestcem.xm.user.mq.sender;

import com.bestcem.xm.user.mq.message.wechat.WeChatMessage;
import lombok.extern.slf4j.Slf4j;

/**
 * 微信消息发送
 *
 * @author panyun <yun.pan@idiaoyan.com>
 * @version v1.0
 * @date 2022/6/28 14:42
 */
@Slf4j
//@Component("weChatMessageSender")
@Deprecated
public class WeChatMessageSender {
    //@Resource
    //private RabbitMqConstantConfig rabbitMqConstantConfig;
    //@Resource
    //private RabbitMessageSender rabbitMessageSender;

    /**
     * 用户个人中心解绑微信
     *
     * @param userId       用户id
     * @param orgId        公司id
     * @param wechatOpenId 微信公众号用户openid
     * @return void
     * @author panyun <yun.pan@idiaoyan.com>
     * @date 2022/6/28 14:45
     */
    public void weChatUnBind(String userId, String orgId, String wechatOpenId) {
        WeChatMessage message = new WeChatMessage(userId, orgId, wechatOpenId);

        //try {
        //    // fanout模式直接发送给python
        //    rabbitMessageSender.sendMsg(rabbitMqConstantConfig.getAppFanoutExchange(), null,
        //            WeChatTopics.WECHAT_UNBIND, dto);
        //
        //    // topic模式发送给java
        //    rabbitMessageSender.sendMsg(rabbitMqConstantConfig.getAppBpDirectExchange(), rabbitMqConstantConfig.getAppBpRoutingKey(),
        //            WeChatTopics.WECHAT_UNBIND, dto);
        //
        //    if (log.isInfoEnabled()) {
        //        log.info("[User.WeChatUnBind] 发送mq消息成功, EXCHANGE_NAME={}, ROUTING_KEY={}, topic={}, mqMsg={}",
        //                rabbitMqConstantConfig.getAppFanoutExchange(), rabbitMqConstantConfig.getAppBpRoutingKey(),
        //                WeChatTopics.WECHAT_UNBIND, JSON.toJSONString(dto));
        //    }
        //} catch (Exception e) {
        //    log.error("[User.WeChatUnBind] 发送mq消息失败, EXCHANGE_NAME={}, ROUTING_KEY={}, topic={}, mqMsg={}",
        //            rabbitMqConstantConfig.getAppFanoutExchange(), rabbitMqConstantConfig.getAppBpRoutingKey(),
        //            WeChatTopics.WECHAT_UNBIND, JSON.toJSONString(dto));
        //}
    }
}
